define(["jquery", "getPath"], function ($, getPath) {
    function ajaxBase(data, url, method) {
        let deferred = $.Deferred();
        let basePath = getPath.getRootPathWeb();
        let dat = data||arguments[0];
        $.ajax({
            type: method||arguments[1],
            url: basePath + url||arguments[2],
            dataType: "json",
            data: data,
            success: function (data) {
                deferred.resolve(data);
            },
            error: function (data) {
                deferred.reject(new Error(data))
            }
        })
        return deferred
    }
    return ajaxBase
})
